#ifndef _CEGUIGDIFont_h__
#define _CEGUIGDIFont_h__

#pragma once

// added by net_sky

#include "CEGUIFont.h"
#include "CEGUIImage.h"

#include <windows.h>
#include <string>
using namespace std;

namespace CEGUI
{

    namespace FontProperties
    {
        class GDIFontPointSize;
    };

class GDIFont : public Font
{
    friend class FontManager;
    friend class FontProperties::GDIFontPointSize;
protected:
    typedef std::vector<Imageset*> ImagesetVector;
    ImagesetVector  d_glyphImages;
    int             m_nFontSize;
    int             m_nTexSize;
    string          m_strFontName;
    uint*           m_lpBuffer;
    HDC             m_hDC;
    HFONT           m_hFont;
    HBITMAP         m_hBitmap;

protected:
    GDIFont(const String& name, const String& fontname, 
        const String& resourceGroup = "");

    GDIFont(const XMLAttributes& attributes);

    virtual ~GDIFont(void);

    void drawGlyphToBuffer(argb_t* buffer, uint buf_width);

    virtual void updateFont(void);
    virtual void writeXMLToStream_impl(XMLSerializer& xml_stream) const;
    
    void addGDIFontProperties(void);

    void free(void);

    virtual bool isCodepointAvailable (utf32 cp);

public:
    virtual void load(void);

    virtual void rasterize (utf32 start_codepoint, utf32 end_codepoint);
    virtual void createGlyph(utf32 codepoint);
};

}

#endif // _CEGUIGDIFont_h__